package jobs.job5.lru;

import java.security.SecureRandom;
import java.util.Base64;

//伪造的数据库，有求必应，对于任意的key都响应一个随机value
public class FakeDatabase {
//    返回随机字符串
    public String get(String key) {
        SecureRandom secRnd = new SecureRandom(key.getBytes());
        byte[] bytes = new byte[8];
        secRnd.nextBytes(bytes);
        return Base64.getEncoder().encodeToString(bytes);
    }
}
